<template>
<div class="build-ID-box">
    <h1 class="Basics-title">
        <h2>{{lable}}</h2>
        <div class="button-group-right">
            <el-button type="edit" @click="educationBuild" v-if="detailBtIsLook">新建</el-button>
        </div>
    </h1>
    <div class="education-list-box">
        <div class="lable" v-if="!isEducationTable">暂无{{lable}}</div>
        <el-form :model="forms" :rules="rules" ref="tableRuleForm" label-width="100px" class="demo-ruleForm">
            <!--表格到此===开始-->
            <el-table :data="forms.educationtableData" style="width: 100%" border v-if="isEducationTable">
                <!--教育背景-->
                <el-table-column prop="date" label="开始时间" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.beginTime'" :rules="rules.beginTime">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.beginTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="结束时间" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.endTime'">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.endTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>

                    </template>
                </el-table-column>
                <el-table-column prop="date" label="类型" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.eduType'">
                            <el-select v-model="scope.row.eduType" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('ABROAD_TYPE')">
                                <el-option v-for="item in eduTypeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学校" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.school'" :rules="rules.school">
                            <el-input v-model="scope.row.school" placeholder="请输入学校" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="专业" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.major'">
                            <el-input v-model="scope.row.major" placeholder="请输入专业" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学历" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.education'">
                            <el-input v-model="scope.row.education" placeholder="请输入学历" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学位" align="center" v-if="WatchOne==='1'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.degree'">
                            <el-select v-model="scope.row.degree" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('EDU_DEGREE')">
                                <el-option v-for="item in degreeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--留学经历-->
                <el-table-column prop="date" label="出国时间" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.beginTime'" :rules="rules.beginTime">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.beginTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="回国时间" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.endTime'">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.endTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="类型" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.abroadType'" :rules="rules.abroadType">
                            <el-select v-model="scope.row.abroadType" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('ABROAD_TYPE')">
                                <el-option v-for="item in abroadTypeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>

                <el-table-column prop="date" label="学制" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.schoolSystem'">
                            <el-input v-model="scope.row.schoolSystem" placeholder="请输入学制" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="国家" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.country'" :rules="rules.country">
                            <el-input v-model="scope.row.country" placeholder="请输入国家" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学校" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.school'" :rules="rules.school">
                            <el-input v-model="scope.row.school" placeholder="请输入学校" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="专业" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.major'">
                            <el-input v-model="scope.row.major" placeholder="请输入专业" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学历" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.education'">
                            <el-input v-model="scope.row.education" placeholder="请输入学历" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="学位" align="center" v-if="WatchOne==='2'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.degree'">
                            <el-select v-model="scope.row.degree" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('EDU_DEGREE')">
                                <el-option v-for="item in degree2List" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--工作经历-->
                <el-table-column prop="date" label="开始时间" align="center" v-if="WatchOne==='3'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.beginTime'" :rules="rules.beginTime">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.beginTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="结束时间" align="center" v-if="WatchOne==='3'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.endTime'">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.endTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="单位" align="center" v-if="WatchOne==='3'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.unit'" :rules="rules.unit">
                            <el-input v-model="scope.row.unit" placeholder="请输入单位" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="职务" align="center" v-if="WatchOne==='3'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.post'">
                            <el-input v-model="scope.row.post" placeholder="请输入职务" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--专业技能及特长-->
                <el-table-column prop="date" label="发证时间" align="center" v-if="WatchOne==='4'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.issueTime'" :rules="rules.issueTime">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.issueTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="技能类别" align="center" v-if="WatchOne==='4'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.skillType'" :rules="rules.skillType">
                            <el-input v-model="scope.row.skillType" placeholder="请输入技能类别" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="专业等级" align="center" v-if="WatchOne==='4'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.skillLevel'" :rules="rules.skillLevel">
                            <el-input v-model="scope.row.skillLevel" placeholder="请输入专业等级" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="发证机关" align="center" v-if="WatchOne==='4'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.issueAuthority'" :rules="rules.issueAuthority">
                            <el-input v-model="scope.row.issueAuthority" placeholder="请输入发证机关" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--家庭成员-->
                <el-table-column prop="date" label="姓名" align="center" v-if="WatchOne==='5'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'" :rules="rules.name">
                            <el-input v-model="scope.row.name" placeholder="请输入姓名" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="关系类型" align="center" v-if="WatchOne==='5'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.familyRelationType'" :rules="rules.familyRelationType">
                            <el-select v-model="scope.row.familyRelationType" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('FAMILY_RELATION_TYPE')" @change="function(value){return getzilist(value,scope.row)}">
                                <el-option v-for="item in familyRelationTypeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="关系" align="center" v-if="WatchOne==='5'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.familyRelation'" :rules="rules.familyRelation">
                            <el-select v-model="scope.row.familyRelation" placeholder="请选择" :disabled="scope.row.isEdit">
                                <el-option v-for="item in familyRelationList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="出生日期" align="center" v-if="WatchOne==='5'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.birthTime'">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.birthTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="单位/学校" align="center" v-if="WatchOne==='5'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.companyOrSchool'">
                            <el-input v-model="scope.row.companyOrSchool" placeholder="请输入单位/学校" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--社会关系-->
                <el-table-column prop="date" label="姓名" align="center" v-if="WatchOne==='6'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'" :rules="rules.name">
                            <el-input v-model="scope.row.name" placeholder="请输入姓名" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="关系类型" align="center" v-if="WatchOne==='6'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.socialRelationType'" :rules="rules.socialRelationType">
                            <el-select v-model="scope.row.socialRelationType" placeholder="请选择" :disabled="scope.row.isEdit" @focus="DropDownAll('SOCIAL_RELATION_TYPE')" @change="function(value){return getsocialRelationList(value,scope.row)}">
                                <el-option v-for="item in socialRelationTypeList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="关系" align="center" v-if="WatchOne==='6'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.socialRelation'" :rules="rules.socialRelation">
                            <el-select v-model="scope.row.socialRelation" placeholder="请选择" :disabled="scope.row.isEdit">
                                <el-option v-for="item in socialRelationList" :key="item.itemValue" :label="item.itemName" :value="item.itemValue"></el-option>
                            </el-select>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="出生日期" align="center" v-if="WatchOne==='6'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.birthTime'">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.birthTime" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="单位/学校" align="center" v-if="WatchOne==='6'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.companyOrSchool'">
                            <el-input v-model="scope.row.companyOrSchool" placeholder="请输入单位/学校" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--表彰及奖励-->
                <el-table-column prop="date" label="时间" align="center" v-if="WatchOne==='7'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.time'" :rules="rules.time">
                            <el-date-picker value-format="yyyy-MM-dd" v-model="scope.row.time" type="date" placeholder="年/月/日" :disabled="scope.row.isEdit"></el-date-picker>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="表彰及奖励内容" align="center" v-if="WatchOne==='7'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.content'" :rules="rules.content">
                            <el-input v-model="scope.row.content" placeholder="请输入表彰及奖励内容" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="授予单位" align="center" v-if="WatchOne==='7'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.unit'" :rules="rules.unit">
                            <el-input v-model="scope.row.unit" placeholder="请输入授予单位" :disabled="scope.row.isEdit"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--新建到此结束====================分割线-->
                <!--家庭成员及社会关系-->
                <el-table-column prop="date" label="称谓" align="center" v-if="WatchOne==='8'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" :disabled="scope.$index!==EditIndex"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="姓名" align="center" v-if="WatchOne==='8'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" :disabled="scope.$index!==EditIndex"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="年龄" align="center" v-if="WatchOne==='8'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" :disabled="scope.$index!==EditIndex"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="政治面貌" align="center" v-if="WatchOne==='8'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" :disabled="scope.$index!==EditIndex"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="工作单位及职务" align="center" v-if="WatchOne==='8'">
                    <template slot-scope="scope">
                        <el-form-item :prop="'educationtableData.'+scope.$index+'.name'">
                            <el-input v-model="scope.row.name" placeholder="请输入内容" :disabled="scope.$index!==EditIndex"></el-input>
                        </el-form-item>
                    </template>
                </el-table-column>
                <!--按钮操作区域-->
                <el-table-column prop="address" label="操作" align="center" width="153">
                    <template slot-scope="scope" v-if="detailBtIsLook">
                        <el-button type="text" size="small" @click="EducationEdit(scope.$index,scope.row)" v-if="scope.row.isEdit">编辑</el-button>
                        <el-button type="text" size="small" @click="EducationSave(scope.$index,scope.row)" v-else>保存</el-button>
                        <el-button type="text" size="small" @click="EducationRemove(scope.$index,scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <!--表格到此===结束-->
        </el-form>
    </div>
</div>
</template>

<script>
export default {
    data() {
        return {
            EditIndex: -1,
            isEducationInput: true,
            isEducationTable: false,
            //表单的校验嵌套
            forms: {
                educationtableData: []
            },

            list: [],
            rules: {
                beginTime: [{
                    required: true,
                    trigger: 'blur'
                }],
                school: [{
                    required: true,
                    trigger: 'blur'
                }],
                abroadType: [{
                    required: true,
                    trigger: 'blur'
                }],
                country: [{
                    required: true,
                    trigger: 'blur'
                }],
                unit: [{
                    required: true,
                    trigger: 'blur'
                }],
                issueTime: [{
                    required: true,
                    trigger: 'blur'
                }],
                skillType: [{
                    required: true,
                    trigger: 'blur'
                }],
                skillLevel: [{
                    required: true,
                    trigger: 'blur'
                }],
                issueAuthority: [{
                    required: true,
                    trigger: 'blur'
                }],
                name: [{
                    required: true,
                    trigger: 'blur'
                }],
                familyRelationType: [{
                    required: true,
                    trigger: 'blur'
                }],
                familyRelation: [{
                    required: true,
                    trigger: 'blur'
                }],
                socialRelationType: [{
                    required: true,
                    trigger: 'blur'
                }],
                socialRelation: [{
                    required: true,
                    trigger: 'blur'
                }],
                time: [{
                    required: true,
                    trigger: 'blur'
                }],
                content: [{
                    required: true,
                    trigger: 'blur'
                }],
                socialRelation: [{
                    required: true,
                    trigger: 'blur'
                }],
            },
            //教育类型(字典类型ABROAD_TYPE)
            eduTypeList: [],
            //学位(字典类型EDU_DEGREE)
            degreeList: [],
            //留学类型(字典类型ABROAD_TYPE)
            abroadTypeList: [],
            //留学学位(字典类型EDU_DEGREE)
            degree2List: [],
            //家庭关系类型(字典类型FAMILY_RELATION_TYPE)
            familyRelationTypeList: [],
            //家庭关系(字典类型FAMILY_RELATION)
            familyRelationList: [],
            //社会关系类型(字典类型SOCIAL_RELATION_TYPE)
            socialRelationTypeList: [],
            //社会关系(字典类型SOCIAL_RELATION)
            socialRelationList: [],
        };
    },
    props: ["WatchOne", "lable", "everyList", "detailBtIsLook"],
    watch: {
        everyList: {
            deep: true,
            handler(newval) {
                if (newval) {
                    newval.forEach(item => {
                        item.isEdit = true;
                    })
                    this.$set(this.forms, 'educationtableData', newval)
                    console.log(this.everyList, "everyList")
                    console.log(this.forms, "forms")
                }
            }
        },
        // '$route.path': function (newVal, oldVal) {
        //     console.log(newVal + '---' + oldVal);

        // }
    },
    created() {
        this.DropDownAll()
    },
    mounted() {

        if (this.$route.path === "/index/IncorruptibleArchives/supervise/detailChange") {
            console.log(this.$route.path, "this.$route.path")
            this.educationBuild()
        } else if (this.$route.path === "/index/IncorruptibleArchives/supervise/detailPersonal") {
            this.educationBuild()
        }
    },
    methods: {
        //重置表单验证---并清空数据
        resetFields(formName) {
            console.log("11111111111111111111111")
            this.$refs['tableRuleForm'].resetFields();
        },
        //	家庭关系类型(字典类型FAMILY_RELATION_TYPE)值改变时
        getzilist(value, row) {
            if (row.familyRelation) {
                row.familyRelation = ""
            }
            let strjsonlist = localStorage.getItem("SET_DICTIONARIES");
            let jsonList = JSON.parse(strjsonlist);
            let downlist = jsonList.filter((item, index) => {
                return item.pItemValue === value && item.typeCode === 'FAMILY_RELATION';
            });
            this.familyRelationList = downlist[0].itemList;
        },
        //社会关系(字典类型SOCIAL_RELATION)
        getsocialRelationList(value, row) {
            if (row.socialRelation) {
                row.socialRelation = ""
            }
            let strjsonlist = localStorage.getItem("SET_DICTIONARIES");
            let jsonList = JSON.parse(strjsonlist);
            let downlist = jsonList.filter((item, index) => {
                return item.pItemValue === value && item.typeCode === 'SOCIAL_RELATION';
            });
            this.socialRelationList = downlist[0].itemList;
        },
        //所有的下拉框的列表数据
        DropDownAll(value) {
            let strjsonlist = localStorage.getItem("SET_DICTIONARIES");
            let jsonList = JSON.parse(strjsonlist);
            let downlist = jsonList.filter((item, index) => {
                return item.typeCode === 'ABROAD_TYPE';
            });
            this.eduTypeList = downlist[0].itemList;
            this.abroadTypeList = downlist[0].itemList;
            let downlist2 = jsonList.filter((item, index) => {
                return item.typeCode === 'EDU_DEGREE';
            });
            this.degreeList = downlist2[0].itemList;
            this.degree2List = downlist2[0].itemList;
            let downlist3 = jsonList.filter((item, index) => {
                return item.typeCode === 'FAMILY_RELATION_TYPE';
            });
            this.familyRelationTypeList = downlist3[0].itemList;
            let downlist4 = jsonList.filter((item, index) => {
                return item.typeCode === 'FAMILY_RELATION';
            });
            this.familyRelationList = downlist4[0].itemList;
            let downlist5 = jsonList.filter((item, index) => {
                return item.typeCode === 'SOCIAL_RELATION_TYPE';
            });
            this.socialRelationTypeList = downlist5[0].itemList;
        },
        //教育新建
        educationBuild() {
            this.isEducationTable = true;
            this.forms.educationtableData.push({
                isEdit: false,
            });
        },
        EducationEdit(index, row) {
            this.isEducationInput = false;
            row.isEdit = false
        },
        EducationSave(index, row) {
            this.isEducationInput = true;
            row.isEdit = true
            let neweducationtableData = JSON.parse(JSON.stringify(this.forms))
            let newArr = []
            newArr = [...neweducationtableData.educationtableData]
            newArr.forEach((item, index) => {
                delete item.isEdit
            })
            this.$emit("update:everyList", newArr);
            this.$refs['tableRuleForm'].validate((valid) => {

            })
        },
        EducationRemove(index) {
            console.log(index);
            this.forms.educationtableData.splice(index, 1);
            let neweducationtableData = JSON.parse(JSON.stringify(this.forms))
            let newArr = []
            newArr = [...neweducationtableData.educationtableData]
            newArr.forEach((item, index) => {
                delete item.isEdit
            })
            this.$emit("update:everyList", newArr);
        },

    },
};
</script>

<style lang="less" scoped>
//教育背景的区域
/deep/.education-list-box {
    .lable {
        font-size: 14px;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 14px;
        padding-bottom: 20px;
    }

    //输入框文字居中
    .el-input {
        height: 36px;

        .el-input__inner {
            height: 36px;
            text-align: center;
            font-size: 14px;
            color: rgba(0, 0, 0, 0.85);
        }
    }

    //表格第一行的样式
    .el-table__header-wrapper {
        .el-table__header {
            .has-gutter {
                tr {
                    th {
                        padding: 10px 0;
                        background-color: #fafafa;
                        font-size: 14px;
                        font-weight: 600;
                        color: rgba(0, 0, 0, 0.85);
                        line-height: 21px;
                    }
                }
            }
        }
    }

    //表格body区域样式修改
    .el-table__body-wrapper {
        .el-table__body {
            tbody {
                .el-table__row {
                    td {
                        padding: 4.5px 0;
                    }
                }
            }
        }
    }
}

//表头标签
.Basics-title {
    padding: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    background-color: white;

    >h2 {
        font-size: 16px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 600;
        color: rgba(51, 51, 51, 1);
        line-height: 16px;
        border-left: 4px solid #3d7fff;
        padding: 0 0 0 10px;
    }

    //编辑按钮的样式
    .el-button--edit {
        width: 70px;
        height: 30px;
        background: rgba(255, 255, 255, 1);
        border-radius: 4px;
        border: 1px solid rgba(61, 127, 255, 1);
        padding: 0;
        color: #3d7fff;
    }
}

.build-ID-box {
    padding: 20px;
    background-color: rgba(255, 255, 255, 1);
    margin-bottom: 10px;
}

//表单校验时的样式
/deep/.el-form-item.is-error .el-input__inner,
.el-form-item.is-error .el-input__inner:focus,
.el-form-item.is-error .el-textarea__inner,
.el-form-item.is-error .el-textarea__inner:focus,
.el-message-box__input input.invalid,
.el-message-box__input input.invalid:focus {
    border-color: #f56c6c !important;
}

/deep/.el-form-item__error {
    display: none;
}

/deep/ .el-form-item__content {
    margin-left: 0 !important;

}

.el-input {
    width: 100%;
}

.el-form-item {
    margin-bottom: 0;
}

/deep/.el-input__inner {
    width: 100%;
}
</style>
